<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title>社交活动平台 - 个人中心</title>
    <style>
        /* 重置样式 */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
            background-color: #f5f7fa;
            color: #333;
            line-height: 1.6;
        }

        /* 容器样式 */
        .container {
            max-width: 480px;
            margin: 0 auto;
            background-color: #fff;
            min-height: 100vh;
        }

        /* 头部用户信息 */
        .user-header {
            background: linear-gradient(135deg, #ff6b35 0%, #f9a825 100%);
            color: white;
            padding: 40px 20px 30px;
            text-align: center;
            position: relative;
        }

        .user-avatar {
            width: 100px;
            height: 100px;
            border-radius: 50%;
            background-color: rgba(255, 255, 255, 0.2);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 40px;
            margin: 0 auto 16px;
            border: 3px solid rgba(255, 255, 255, 0.3);
        }

        .user-name {
            font-size: 24px;
            font-weight: bold;
            margin-bottom: 8px;
        }

        .user-id {
            font-size: 14px;
            opacity: 0.9;
            margin-bottom: 16px;
        }

        .user-stats {
            display: flex;
            justify-content: center;
            gap: 20px;
            margin-top: 16px;
        }

        .stat-item {
            text-align: center;
        }

        .stat-number {
            font-size: 20px;
            font-weight: bold;
        }

        .stat-label {
            font-size: 12px;
            opacity: 0.8;
        }

        /* 用户标签 */
        .user-tags {
            display: flex;
            justify-content: center;
            gap: 8px;
            margin-top: 16px;
            flex-wrap: wrap;
        }

        .user-tag {
            background-color: rgba(255, 255, 255, 0.2);
            color: white;
            padding: 4px 12px;
            border-radius: 16px;
            font-size: 12px;
        }

        /* 功能菜单 */
        .menu-section {
            padding: 20px;
            border-bottom: 1px solid #eee;
        }

        .menu-title {
            font-size: 16px;
            font-weight: bold;
            margin-bottom: 16px;
            color: #333;
            display: flex;
            align-items: center;
        }

        .menu-title-icon {
            margin-right: 8px;
        }

        .menu-list {
            display: grid;
            gap: 12px;
        }

        .menu-item {
            display: flex;
            align-items: center;
            padding: 16px;
            border-radius: 12px;
            background-color: #f9f9f9;
            transition: all 0.3s ease;
            cursor: pointer;
        }

        .menu-item:hover {
            background-color: #e8f5e9;
            transform: translateY(-2px);
        }

        .menu-icon {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            background-color: #f0f8ff;
            display: flex;
            align-items: center;
            justify-content: center;
            margin-right: 16px;
            font-size: 20px;
        }

        .menu-text {
            flex-grow: 1;
            font-size: 16px;
            color: #333;
        }

        .menu-arrow {
            font-size: 18px;
            color: #999;
        }

        /* 我的活动 */
        .my-activities {
            padding: 20px;
        }

        .section-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 16px;
        }

        .section-title {
            font-size: 18px;
            font-weight: bold;
            color: #333;
        }

        .view-all {
            font-size: 14px;
            color: #ff6b35;
        }

        .activity-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 16px;
        }

        .activity-card {
            border-radius: 12px;
            overflow: hidden;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
            transition: all 0.3s ease;
            cursor: pointer;
        }

        .activity-card:hover {
            transform: translateY(-4px);
            box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
        }

        .activity-cover {
            width: 100%;
            height: 80px;
            object-fit: cover;
        }

        .activity-info {
            padding: 12px;
        }

        .activity-title {
            font-size: 14px;
            font-weight: bold;
            margin-bottom: 6px;
            color: #333;
        }

        .activity-meta {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 12px;
            color: #666;
        }

        .meta-icon {
            font-size: 14px;
        }

        /* 底部导航 */
        .bottom-nav {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            background-color: white;
            border-top: 1px solid #eee;
            display: flex;
            justify-content: space-around;
            padding: 12px 0;
            z-index: 100;
        }

        .nav-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            color: #9e9e9e;
            font-size: 12px;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .nav-item.active {
            color: #ff6b35;
        }

        .nav-icon {
            font-size: 20px;
            margin-bottom: 4px;
        }

        /* 加载动画 */
        .loading {
            text-align: center;
            padding: 40px 20px;
        }

        .spinner {
            width: 36px;
            height: 36px;
            border: 4px solid #f3f3f3;
            border-top: 4px solid #ff6b35;
            border-radius: 50%;
            animation: spin 1s linear infinite;
            margin: 0 auto 20px;
        }

        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }

        /* 弹窗样式 */
        .modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: rgba(0, 0, 0, 0.5);
            z-index: 1000;
            justify-content: center;
            align-items: center;
        }

        .modal-content {
            background-color: white;
            border-radius: 16px;
            width: 85%;
            max-width: 320px;
            padding: 24px;
            text-align: center;
            transform: translateY(20px);
            opacity: 0;
            transition: all 0.3s ease;
        }

        .modal.show {
            transform: translateY(0);
            opacity: 1;
        }

        .modal-title {
            font-size: 20px;
            font-weight: bold;
            margin-bottom: 16px;
            color: #333;
        }

        .modal-message {
            margin-bottom: 24px;
            color: #666;
            line-height: 1.6;
        }

        .modal-actions {
            display: flex;
            gap: 12px;
        }

        .modal-btn {
            flex: 1;
            padding: 12px;
            border-radius: 8px;
            font-weight: bold;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .cancel-btn {
            background-color: #f5f5f5;
            color: #666;
        }

        .confirm-btn {
            background: linear-gradient(135deg, #ff6b35 0%, #f9a825 100%);
            color: white;
        }

        /* 响应式适配 */
        @media (max-width: 480px) {
            .user-header {
                padding: 30px 16px 20px;
            }
            
            .user-avatar {
                width: 80px;
                height: 80px;
                font-size: 32px;
            }
            
            .user-name {
                font-size: 20px;
            }
            
            .activity-grid {
                grid-template-columns: repeat(2, 1fr);
                gap: 12px;
            }
        }

        /* 动画效果 */
        @keyframes fadeInUp {
            from {
                opacity: 0;
                transform: translateY(20px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .menu-item {
            animation: fadeInUp 0.3s ease forwards;
        }

        /* 用户等级标识 */
        .user-level {
            display: inline-block;
            padding: 4px 12px;
            border-radius: 20px;
            font-size: 12px;
            background-color: #ffebee;
            color: #e53935;
            margin-left: 8px;
        }

        /* 活动卡片动画延迟 */
        .activity-card:nth-child(1) { animation-delay: 0.1s; }
        .activity-card:nth-child(2) { animation-delay: 0.2s; }
        .activity-card:nth-child(3) { animation-delay: 0.3s; }
        .activity-card:nth-child(4) { animation-delay: 0.4s; }

        /* 功能图标颜色 */
        .icon-activity { color: #ff6b35; }
        .icon-message { color: #45b7d1; }
        .icon-friend { color: #388e3c; }
        .icon-setting { color: #9c27b0; }
        .icon-achievement { color: #ff9800; }

        /* 个人资料卡片 */
        .profile-card {
            background-color: #f9f9f9;
            border-radius: 12px;
            padding: 16px;
            margin-bottom: 20px;
        }

        .profile-row {
            display: flex;
            justify-content: space-between;
            padding: 12px 0;
            border-bottom: 1px solid #eee;
        }

        .profile-row:last-child {
            border-bottom: none;
        }

        .profile-label {
            color: #666;
        }

        .profile-value {
            font-weight: 500;
        }
    </style>
</head>
<body>
    <div class="container">
        <!-- 用户头部信息 -->
        <header class="user-header">
            <div class="user-avatar">👤</div>
            <h1 class="user-name">张小明<span class="user-level">🌟 社交达人</span></h1>
            <p class="user-id">ID: 20240101</p>
            
            <div class="user-stats">
                <div class="stat-item">
                    <div class="stat-number">12</div>
                    <div class="stat-label">发起活动</div>
                </div>
                <div class="stat-item">
                    <div class="stat-number">28</div>
                    <div class="stat-label">参与活动</div>
                </div>
                <div class="stat-item">
                    <div class="stat-number">15</div>
                    <div class="stat-label">好友数量</div>
                </div>
            </div>

            <div class="user-tags">
                <span class="user-tag">运动爱好者</span>
                <span class="user-tag">读书分享者</span>
                <span class="user-tag">户外探险家</span>
            </div>
        </header>

        <!-- 功能菜单 -->
        <div class="menu-section">
            <h3 class="menu-title"><span class="menu-title-icon">⚙️</span> 功能设置</h3>
            <div class="menu-list">
                <div class="menu-item" data-action="profile">
                    <div class="menu-icon icon-activity">👤</div>
                    <span class="menu-text">个人资料</span>
                    <span class="menu-arrow">›</span>
                </div>
                <div class="menu-item" data-action="settings">
                    <div class="menu-icon icon-setting">⚙️</div>
                    <span class="menu-text">账户设置</span>
                    <span class="menu-arrow">›</span>
                </div>
                <div class="menu-item" data-action="privacy">
                    <div class="menu-icon icon-setting">🔒</div>
                    <span class="menu-text">隐私设置</span>
                    <span class="menu-arrow">›</span>
                </div>
                <div class="menu-item" data-action="notifications">
                    <div class="menu-icon icon-setting">🔔</div>
                    <span class="menu-text">消息通知</span>
                    <span class="menu-arrow">›</span>
                </div>
            </div>
        </div>

        <!-- 我的活动 -->
        <div class="my-activities">
            <div class="section-header">
                <h3 class="section-title">我的活动</h3>
                <span class="view-all" data-action="all-activities">查看全部</span>
            </div>
            
            <div class="activity-grid">
                <!-- 活动卡片 1 -->
                <div class="activity-card" data-activity-id="1">
                    <img src="https://images.unsplash.com/photo-1501854140801-50d01698950b?w=200&h=80&fit=crop" alt="户外徒步活动" class="activity-cover">
                    <div class="activity-info">
                        <h4 class="activity-title">周末户外徒步</h4>
                        <div class="activity-meta">
                            <span class="meta-icon">📍</span>
                            <span>城市公园</span>
                        </div>
                    </div>
                </div>

                <!-- 活动卡片 2 -->
                <div class="activity-card" data-activity-id="2">
                    <img src="https://images.unsplash.com/photo-1504805572947-34fad45aed93?w=200&h=80&fit=crop" alt="读书分享会" class="activity-cover">
                    <div class="activity-info">
                        <h4 class="activity-title">经典小说分享</h4>
                        <div class="activity-meta">
                            <span class="meta-icon">📍</span>
                            <span>咖啡书店</span>
                        </div>
                    </div>
                </div>

                <!-- 活动卡片 3 -->
                <div class="activity-card" data-activity-id="3">
                    <img src="https://images.unsplash.com/photo-1543269865-cbf427effbad?w=200&h=80&fit=crop" alt="摄影交流会" class="activity-cover">
                    <div class="activity-info">
                        <h4 class="activity-title">周末摄影交流</h4>
                        <div class="activity-meta">
                            <span class="meta-icon">📍</span>
                            <span>城市广场</span>
                        </div>
                    </div>
                </div>

                <!-- 活动卡片 4 -->
                <div class="activity-card" data-activity-id="4">
                    <img src="https://images.unsplash.com/photo-1503376780353-7e6692767b70?w=200&h=80&fit=crop" alt="美食探店" class="activity-cover">
                    <div class="activity-info">
                        <h4 class="activity-title">城市美食探店</h4>
                        <div class="activity-meta">
                            <span class="meta-icon">📍</span>
                            <span>美食街</span>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <!-- 我的资料 -->
        <div class="menu-section">
            <h3 class="menu-title"><span class="menu-title-icon">📊</span> 个人资料</h3>
            <div class="profile-card">
                <div class="profile-row">
                    <span class="profile-label">昵称</span>
                    <span class="profile-value">张小明</span>
                </div>
                <div class="profile-row">
                    <span class="profile-label">性别</span>
                    <span class="profile-value">男</span>
                </div>
                <div class="profile-row">
                    <span class="profile-label">年龄</span>
                    <span class="profile-value">28岁</span>
                </div>
                <div class="profile-row">
                    <span class="profile-label">城市</span>
                    <span class="profile-value">北京</span>
                </div>
                <div class="profile-row">
                    <span class="profile-label">职业</span>
                    <span class="profile-value">软件工程师</span>
                </div>
            </div>
        </div>

        <!-- 底部导航 -->
        <nav class="bottom-nav">
            <div class="nav-item" data-page="home">
                <span class="nav-icon">🏠</span>
                <span>首页</span>
            </div>
            <div class="nav-item" data-page="search">
                <span class="nav-icon">🔍</span>
                <span>搜索</span>
            </div>
            <div class="nav-item" data-page="publish">
                <span class="nav-icon">➕</span>
                <span>发布</span>
            </div>
            <div class="nav-item active" data-page="profile">
                <span class="nav-icon">👤</span>
                <span>我的</span>
            </div>
        </nav>

        <!-- 加载状态 -->
        <div class="loading" id="loadingIndicator">
            <div class="spinner"></div>
            <p>加载中...</p>
        </div>

        <!-- 通知 Toast -->
        <div id="toast" style="display: none; position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background-color: #4caf50; color: white; padding: 12px 24px; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); z-index: 1001;"></div>
    </div>

    <script>
        // 全局变量
        let userStats = {
            activitiesCreated: 12,
            activitiesJoined: 28,
            friendsCount: 15
        };

        // 初始化
        document.addEventListener('DOMContentLoaded', function() {
            initEventListeners();
            simulateLoading();
            
            // 模拟用户数据更新
            setTimeout(() => {
                updateStatsDisplay();
            }, 1000);
        });

        // 初始化事件监听器
        function initEventListeners() {
            // 功能菜单点击
            const menuItems = document.querySelectorAll('.menu-item');
            menuItems.forEach(item => {
                item.addEventListener('click', function() {
                    const action = this.dataset.action;
                    handleMenuAction(action);
                });
            });

            // 查看全部活动
            const viewAllBtn = document.querySelector('.view-all');
            if (viewAllBtn) {
                viewAllBtn.addEventListener('click', function() {
                    alert('跳转到所有活动页面');
                });
            }

            // 活动卡片点击
            const activityCards = document.querySelectorAll('.activity-card');
            activityCards.forEach(card => {
                card.addEventListener('click', function() {
                    const activityId = this.dataset.activityId;
                    alert(`查看活动详情：${activityId}`);
                });
            });

            // 底部导航切换
            const navItems = document.querySelectorAll('.nav-item');
            navItems.forEach(item => {
                item.addEventListener('click', function() {
                    // 移除所有激活状态
                    navItems.forEach(i => i.classList.remove('active'));
                    // 添加当前激活状态
                    this.classList.add('active');
                    
                    const page = this.dataset.page;
                    handleNavigation(page);
                });
            });

            // 模拟用户数据更新
            setInterval(updateStatsDisplay, 30000); // 每30秒更新一次
        }

        // 处理菜单操作
        function handleMenuAction(action) {
            switch(action) {
                case 'profile':
                    alert('跳转到个人资料页面');
                    break;
                case 'settings':
                    alert('跳转到账户设置页面');
                    break;
                case 'privacy':
                    alert('跳转到隐私设置页面');
                    break;
                case 'notifications':
                    alert('跳转到消息通知页面');
                    break;
            }
        }

        // 更新统计显示
        function updateStatsDisplay() {
            document.querySelector('.stat-number').textContent = userStats.activitiesCreated;
        }

        // 处理导航切换
        function handleNavigation(page) {
            switch(page) {
                case 'home':
                    alert('跳转到首页');
                    break;
                case 'search':
                    alert('跳转到搜索页面');
                    break;
                case 'publish':
                    alert('跳转到发布页面');
                    break;
                case 'profile':
                    // 个人中心无需特殊处理
                    break;
            }
        }

        // 显示加载状态
        function showLoading() {
            const loading = document.getElementById('loadingIndicator');
            loading.style.display = 'block';
        }

        // 隐藏加载状态
        function hideLoading() {
            const loading = document.getElementById('loadingIndicator');
            loading.style.display = 'none';
        }

        // 模拟加载效果
        function simulateLoading() {
            showLoading();
            setTimeout(() => {
                hideLoading();
            }, 1500);
        }

        // 显示成功提示
        function showSuccessToast(message) {
            const toast = document.getElementById('toast');
            toast.textContent = message;
            toast.style.display = 'block';
            
            // 3秒后自动隐藏
            setTimeout(() => {
                toast.style.display = 'none';
            }, 3000);
        }

        // 添加触摸反馈效果
        const buttons = document.querySelectorAll('button, .menu-item, .activity-card');
        buttons.forEach(button => {
            button.addEventListener('touchstart', function() {
                this.style.transform = 'scale(0.98)';
            });
            
            button.addEventListener('touchend', function() {
                this.style.transform = 'scale(1)';
            });
        });

        // 添加页面滚动效果
        let lastScrollTop = 0;
        window.addEventListener('scroll', function() {
            const scrollTop = window.pageYOffset || document.documentElement.scrollTop;
            
            // 隐藏/显示底部导航
            const bottomNav = document.querySelector('.bottom-nav');
            if (scrollTop > lastScrollTop && scrollTop > 100) {
                bottomNav.style.transform = 'translateY(100%)';
            } else {
                bottomNav.style.transform = 'translateY(0)';
            }
            
            lastScrollTop = scrollTop;
        });

        // 添加返回顶部功能
        window.addEventListener('scroll', function() {
            if (window.pageYOffset > 300) {
                // 可以添加返回顶部按钮
            }
        });

        // 模拟数据更新（用于演示）
        setTimeout(() => {
            // 更新活动统计
            const stats = document.querySelectorAll('.stat-number');
            if (stats.length > 0) {
                stats[0].textContent = userStats.activitiesCreated + Math.floor(Math.random() * 3);
                stats[1].textContent = userStats.activitiesJoined + Math.floor(Math.random() * 5);
                stats[2].textContent = userStats.friendsCount + Math.floor(Math.random() * 2);
            }
        }, 5000);

        // 模拟用户等级更新
        setTimeout(() => {
            const levelBadge = document.querySelector('.user-level');
            if (levelBadge) {
                levelBadge.textContent = '🌟 高级达人';
            }
        }, 8000);
    </script>
</body>
</html>
